package Demo1;

import java.util.Scanner;

public class Main10 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int a = 0, b = 1, c = 0;
        while (c < num) {
            c = a + b;
            a = b;
            b = c;
        }
        System.out.println(a);
        System.out.println(b);
        int ret = Integer.MAX_VALUE;

        if (num - a < ret) ret = num - a;
        if (c - num < ret) ret = c - num;
        System.out.println(ret);
    }
}